//
//  MyMusicViewController.m
//  CatMusic
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MyMusicViewController.h"
#import "SetViewController.h"
#import "PlayViewController.h"
#import "LandViewController.h"
#import "listeningTestViewController.h"
#import "MyLoveViewController.h"
#import "SongViewController.h"
//#import "MyMusicTableViewCell.h"

@interface MyMusicViewController ()

@property (nonatomic , retain)UIButton *bu2;
//@property (nonatomic , retain)UITableView *tableView;
@end

@implementation MyMusicViewController
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor cyanColor];
    // Do any additional setup after loading the view.
    self.title = @"我的音乐";
    // 设置左边按钮
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeSystem];
    leftButton.frame = CGRectMake(10, 10, 20, 20);
    [leftButton setBackgroundImage:[UIImage imageNamed:@"iconfont-shezhi"] forState:UIControlStateNormal];
    [leftButton addTarget:self action:@selector(leftButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:leftButton];
    
    // 设置右边按钮
    UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeSystem];
    rightButton.frame = CGRectMake(200, 10, 20, 20);
    [rightButton setBackgroundImage:[UIImage imageNamed:@"iconfont-xiangyou"] forState:UIControlStateNormal];
    [rightButton addTarget:self action:@selector(rightButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:rightButton];
    
//    self.tableView = [[UITableView alloc]initWithFrame:[[UIScreen mainScreen]bounds] style:UITableViewStylePlain];
//    self.tableView.delegate = self;
//    self.tableView.dataSource =self;
//    [self.view addSubview:self.tableView];
    
    
    
    
    
    
    // 登陆
    UIButton *bu1 = [UIButton buttonWithType:UIButtonTypeSystem];
    bu1.frame= CGRectMake(10,100, self.view.frame.size.width - 20, 60);
    [bu1 setTitle:@"登陆" forState:UIControlStateNormal];
    [bu1 addTarget:self action:@selector(landingAction:) forControlEvents:UIControlEventTouchUpInside];
    bu1.layer.borderWidth = 1;
    bu1.layer.cornerRadius = 5;
    [self.view addSubview:bu1];

    UIButton *bu2 = [UIButton buttonWithType:UIButtonTypeSystem];
    bu2.frame= CGRectMake(10, 240, self.view.frame.size.width - 20, 60);
    [bu2 setTitle:@"本地歌曲" forState:UIControlStateNormal];
    [bu2 addTarget:self action:@selector(songAction:) forControlEvents:UIControlEventTouchUpInside];
    bu2.layer.borderWidth = 1;
    bu2.layer.cornerRadius = 5;
    [self.view addSubview:bu2];

    UIButton *bu3 = [UIButton buttonWithType:UIButtonTypeSystem];
    bu3.frame= CGRectMake(10, 320, self.view.frame.size.width - 20, 60);
    [bu3 setTitle:@"试听列表" forState:UIControlStateNormal];
    [bu3 addTarget:self action:@selector(listenAction:) forControlEvents:UIControlEventTouchUpInside];
    bu3.layer.borderWidth = 1;
    bu3.layer.cornerRadius = 5;
    [self.view addSubview:bu3];
    
    UIButton *bu4 = [UIButton buttonWithType:UIButtonTypeSystem];
    bu4.frame= CGRectMake(10, 400, self.view.frame.size.width - 20, 60);
    [bu4 setTitle:@"我喜欢" forState:UIControlStateNormal];
    [bu4 addTarget:self action:@selector(myLoveAction:) forControlEvents:UIControlEventTouchUpInside];
    bu4.layer.borderWidth = 1;
    bu4.layer.cornerRadius = 5;
    [self.view addSubview:bu4];

    
    
    
    
    
}
- (void)leftButtonAction:(UIButton *)button
{
    SetViewController *setVC = [[SetViewController alloc]init];
    [self.navigationController pushViewController:setVC animated:YES];
}
- (void)rightButtonAction:(UIButton *)button
{
    PlayViewController *playVC = [[PlayViewController alloc]init];
    [self.navigationController pushViewController:playVC animated:YES];
}

#warning tableView  待研发中

//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
//{
//    return 1;
//}
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    static NSString *reuse = @"reuse";
//    MyMusicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
//    if (cell == nil) {
//        cell = [[MyMusicTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuse];
//    }
//    cell.myLoveLabel.text = @"我喜欢";
//    cell.landLabel.text = @"登陆";
//    cell.songLabel.text = @"本地歌曲";
//    cell.listenLabel.text = @"试听列表";
//    return cell;
//}
//
//- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    return 600;
//}







- (void)landingAction:(UIButton *)button
{
    LandViewController *landVC = [[LandViewController alloc]init];
    [self.navigationController pushViewController:landVC animated:YES];
}
- (void)songAction:(UIButton *)button
{
    SongViewController *songVC = [[SongViewController alloc]init];
    [self.navigationController pushViewController:songVC animated:YES];
}
- (void)listenAction:(UIButton *)button
{
    listeningTestViewController *listenVC = [[listeningTestViewController alloc]init];
    [self.navigationController pushViewController:listenVC animated:YES];
}
- (void)myLoveAction:(UIButton *)button
{
    MyLoveViewController *loveVC = [[MyLoveViewController alloc]init];
    [self.navigationController pushViewController:loveVC animated:YES];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
